from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models

# Create your models here.
class Student(models.Model):
    sno = models.CharField(primary_key=True, blank=False, max_length=10)
    sname = models.CharField(max_length=12, blank=True, unique=True)
    sage = models.IntegerField(validators=[MaxValueValidator(100), MinValueValidator(0)])
    ssex = models.CharField(max_length=2, default='男')
    sdept = models.CharField(max_length=20)

    class Meta:
        db_table = 'student'

